Crate tui_big_text
source ·Expand description
tui-big-text is a rust crate that renders large pixel text as a Ratatui widget using the glyphs from the font8x8 crate.
§Installation
cargo add ratatui tui-big-text
§Usage
Create a BigText
widget using BigTextBuilder
and pass it to Frame::render_widget
to
render be rendered. The builder allows you to customize the Style
of the widget and the
PixelSize
of the glyphs. The PixelSize
can be used to control how many character cells
are used to represent a single pixel of the 8x8 font.
§Example
use anyhow::Result;
use ratatui::prelude::*;
use tui_big_text::{BigTextBuilder, PixelSize};
fn render(frame: &mut Frame) -> Result<()> {
let big_text = BigTextBuilder::default()
.pixel_size(PixelSize::Full)
.style(Style::new().blue())
.lines(vec![
"Hello".red().into(),
"World".white().into(),
"~~~~~".into(),
])
.build()?;
frame.render_widget(big_text, frame.size());
Ok(())
}
Structs§
- Displays one or more lines of text using 8x8 pixel characters.
- Builder for
BigText
.
Enums§
- Error type for BigTextBuilder